<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>

<%@include file="../../WEB-INF/jspf/admin.jspf" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
        <link href="../../jq/redmond/jquery-ui-1.10.3.custom.min.css" type="text/css" rel="stylesheet"/>
        <link href="../../css/main.css" type="text/css" rel="stylesheet"/>
        <link href="../../jq/menu/menu.css" type="text/css" rel="stylesheet"/>
        <link href="../../jq/menu/submenu.css" type="text/css" rel="stylesheet"/>

        <link href="../../parainfo/form/form.css" type="text/css" rel="stylesheet"/>
        <link href="../../parainfo/table/table.css" type="text/css" rel="stylesheet"/>

        <script src="../../jq/jquery-1.10.2.min.js" type="text/javascript"></script>
        <script src="../../jq/jquery-ui-1.10.3.custom.min.js" type="text/javascript"></script>
        <script src="../../jq/i18n/jquery.ui.datepicker-es.min.js" type="text/javascript"></script>
        <script src="../../jq/menu/menu.js" type="text/javascript"></script>
        <script src="../../jq/menu/submenu.js" type="text/javascript"></script>

        <script src="../../parainfo/form/form.js" type="text/javascript"></script>
        <script src="../../parainfo/table/table.js" type="text/javascript"></script>
        <script src="js/horarios.js" type="text/javascript"></script>
    </head>
    <body>
        <div id="ctop">
            <%@include file="../../WEB-INF/jspf/top.jspf" %>
        </div>

        <div id="m_menu">
            <%@include file="../../WEB-INF/jspf/menu.jspf" %>
        </div>

        <div id="cmenu2">
            <%@include file="../../WEB-INF/jspf/submenu.jspf" %>
        </div>

        <div id="cdata">
            <h2 style="text-align: center;margin-bottom: 20px;color: #3fa7c5">Mantenimiento de Horarios</h2>

            <form class="parainfo" action="#" style="margin: auto;display: table">
                <fieldset>
                    <legend>Filtro de Búsqueda</legend>

                    <table>
                        <tr>
                            <td>Año</td>
                            <td>
                                <select id="annio" onchange="jsannio();" style="width: 320px">
                                    <option value="0">Seleccione...</option>
                                </select>

                            </td>
                        </tr>
                        <tr>
                            <td>Unid. Ejecutora</td>
                            <td>
                                <select id="uejecutora" onchange="jsuejecutora();" style="width: 320px">
                                    <option value="0">Seleccione...</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>Corte</td>
                            <td>
                                <select id="corte" onchange="jscorte();" style="width: 320px">
                                    <option value="0">Seleccione...</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>Estado</td>
                            <td>
                                <select id="estado" style="width: 320px">
                                    <option value="0">Seleccione...</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <th colspan="2" style="text-align: center;padding: 20px">
                                <input type="button" onclick="jsQry();"
                                       value="Actualizar"/>
                            </th>
                        </tr>
                    </table>
                </fieldset>
            </form>



            <table style="margin: auto">


                <tr>
                    <td style="vertical-align: top">
                        <table class="parainfo" style="width: 400px">
                            <thead>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>Descripci&oacute;n</td>
                                    <td>Tipo</td>
                                    <td>Estado</td>
                                </tr>
                            </thead>

                            <tbody id="qbody">
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                    <td>&nbsp;</td>
                                </tr>
                            </tbody>
                        </table>
                    </td>

                    <td style="vertical-align: top">
                        <table class="crud">
                            <tr>

                                <td>
                                    <a href="#" onclick="jsIns();" title="Nuevo">
                                        <img src="../../images/ins.png"/></a>
                                </td>
                                <td>
                                    <a href="#" onclick="jsCon();" title="Consultar">
                                        <img src="../../images/find2.png"/></a>
                                </td>
                            </tr>
                            <tr>

                                <td>
                                    <a href="#" onclick="jsEst();" title="Cambiar Estado">
                                        <img src="../../images/upd_est.png"/></a>
                                </td>
                                <td>
                                    <a href="#" onclick="jsExcel();" title="Exportar a Excel">
                                        <img src="../../images/excel.png"/></a>
                                </td>
                            </tr>

                        </table>
                    </td>
                </tr>
            </table>



            <%-- para INS  --%>
            <div style="display: none">
                <div id="dins" title="Nuevo Horario">
                    <table>

                        <tr>

                            <td>Año</td>
                            <td  >
                                <input type="text" id="anno_ins" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>

                            <td>Und.&nbsp;Ejecutora</td>
                            <td  >
                                <input type="text" id="uejecutora_ins" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>

                            <td>Corte</td>
                            <td  >
                                <input type="text" id="corte_ins" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>

                        <tr>
                            <td>Descripci&oacute;n</td>
                            <td>
                                <input type="text" id="horario_ins" 
                                       maxlength="100" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Tipo</td>
                            <td>
                                                           
                                 <select id="tipo_ins"  style="width: 200px">
                                    <option value="0">Seleccione...</option>
                                </select>
                                
                                
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2">Detalle</td>
                        </tr>
                        <tr>
                            <td class="ui-widget-header">D&iacute;a</td>
                            <td class="ui-widget-header">Turno</td>
                        </tr>
                        <tr>
                            <td>Lunes</td>
                            <td>
                                <select id="turno_ins_lun"  style="width: 450px">
                                    <option value="0">Seleccione...</option>
                                </select>

                            </td>
                        </tr>
                        <tr>
                            <td>Martes</td>
                            <td>
                                <select id="turno_ins_mar"  style="width: 450px">
                                    <option value="0">Seleccione...</option>
                                </select>
                            </td>
                        </tr>
                        <tr>
                            <td>Mi&eacute;rcoles</td>
                            <td>

                                <select id="turno_ins_mie"  style="width: 450px">
                                    <option value="0">Seleccione...</option>
                                </select>


                            </td>
                        </tr>
                        <tr>
                            <td>Jueves</td>
                            <td>


                                <select id="turno_ins_jue"  style="width: 450px">
                                    <option value="0">Seleccione...</option>
                                </select>


                            </td>
                        </tr>
                        <tr>
                            <td>Viernes</td>
                            <td>
                                <select id="turno_ins_vie"  style="width: 450px">
                                    <option value="0">Seleccione...</option>
                                </select>

                            </td>
                        </tr>
                        <tr>
                            <td>S&aacute;bado</td>
                            <td>
                                <select id="turno_ins_sab"  style="width: 450px">
                                    <option value="0">No Laborable...</option>
                                </select>
                                

                            </td>
                        </tr>
                        <tr>
                            <td>Domingo</td>
                            <td>
                                
                                <select id="turno_ins_dom"  style="width: 450px">
                                    <option value="0">No Laborable...</option>
                                </select>
                                
                               
                            </td>
                        </tr>
                    </table>

                    <p id="error_ins" style="color: red"></p>
                </div>
            </div>

            <%-- para consulta  --%>
            <div style="display: none">
                <div id="dcon" title="Consulta de Horario">
                    <table>
                           <tr>
                            <td>Año</td>
                            <td colspan="3" >
                                <input type="text" id="anno_con" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Und.&nbsp;Ejecutora</td>
                            <td colspan="3" >
                                <input type="text" id="uejecutora_con" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Corte</td>
                            <td colspan="3" >
                                <input type="text" id="corte_con" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>


                        <tr>
                            <td>Descripci&oacute;n</td>
                            <td>
                                <input type="text" id="horario_con"
                                       style="width: 300px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Tipo</td>
                            <td>
                                <input type="text" id="tipo_con" 
                                       style="width: 200px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2">Detalle</td>
                        </tr>
                        <tr>
                            <td class="ui-widget-header">D&iacute;a</td>
                            <td class="ui-widget-header">Turno</td>
                        </tr>
                        <tr>
                            <td>Lunes</td>
                            <td>
                                <input type="text" id="turno_con_lun" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Martes</td>
                            <td>
                                <input type="text" id="turno_con_mar" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Mi&eacute;rcoles</td>
                            <td>
                                <input type="text" id="turno_con_mie" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Jueves</td>
                            <td>
                                <input type="text" id="turno_con_jue" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Viernes</td>
                            <td>
                                <input type="text" id="turno_con_vie" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>S&aacute;bado</td>
                            <td>
                                <input type="text" id="turno_con_sab" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Domingo</td>
                            <td>
                                <input type="text" id="turno_con_dom" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                    </table>

                    <p id="error_con" style="color: red"></p>
                </div>
            </div>

            <%-- para estado  --%>
            <div style="display: none">
                <div id="dest" title="Cambio de Estado de Horario">
                    <input type="hidden" id="idhorario_est"/>
                    <input type="hidden" id="idestado_est"/>
                    <table>
                        
                          <tr>
                            <td>Año</td>
                            <td colspan="3" >
                                <input type="text" id="anno_est" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Und.&nbsp;Ejecutora</td>
                            <td colspan="3" >
                                <input type="text" id="uejecutora_est" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Corte</td>
                            <td colspan="3" >
                                <input type="text" id="corte_est" readonly="readonly"
                                       maxlength="200" style="width: 300px"/>
                            </td>
                        </tr>
                        
                        <tr>
                            <td>Descripci&oacute;n</td>
                            <td>
                                <input type="text" id="horario_est"
                                       style="width: 300px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Estado 1</td>
                            <td colspan="2">
                                <input type="text" id="actual_est" readonly="readonly" 
                                       maxlength="200" style="width: 100px"/> 
                                Actual en base de datos
                            </td>
                        </tr>
                        <tr>
                            <td>Estado 2</td>
                            <td colspan="2">
                                <input type="text" id="despues_est" readonly="readonly" 
                                       maxlength="200" style="width: 100px"/> 
                                Clic en: "<span style="font-weight: bold">Guardar</span>"
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                            <td colspan="2">Detalle</td>
                        </tr>
                        <tr>
                            <td class="ui-widget-header">D&iacute;a</td>
                            <td class="ui-widget-header">Turno</td>
                        </tr>
                        <tr>
                            <td>Lunes</td>
                            <td>
                                <input type="text" id="turno_est_lun" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Martes</td>
                            <td>
                                <input type="text" id="turno_est_mar" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Mi&eacute;rcoles</td>
                            <td>
                                <input type="text" id="turno_est_mie" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Jueves</td>
                            <td>
                                <input type="text" id="turno_est_jue" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Viernes</td>
                            <td>
                                <input type="text" id="turno_est_vie" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>S&aacute;bado</td>
                            <td>
                                <input type="text" id="turno_est_sab" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                        <tr>
                            <td>Domingo</td>
                            <td>
                                <input type="text" id="turno_est_dom" 
                                       style="width: 450px" readonly="readonly"/>
                            </td>
                        </tr>
                    </table>

                    <p id="error_est" style="color: red"></p>
                </div>
            </div>

            <%-- para mensajes  --%>
            <div style="display: none">
                <div id="dmsg" title="Mensaje">
                    <p id="msg" style="text-align: center;color: #800;margin: 20px"></p>
                </div>
            </div>
        </div>

        <%-- para excel  --%>
        <form id="to_excel" action="HorariosExc" target="_parent" method="post">
              <input type="hidden" id="data_excel" name="data_excel"/>
            <input type="hidden" id="anio_excel" name="anio_excel"/>
            <input type="hidden" id="ueje_excel" name="ueje_excel"/>
            <input type="hidden" id="cort_excel" name="cort_excel"/>
            <input type="hidden" id="estado_excel" name="estado_excel"/>
        </form>
    </body>
</html>

